package com.t.bricks.bussiness.db.dao.systemparams.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.t.bricks.bussiness.db.dao.systemparams.SystemParamsDao;
import com.t.bricks.bussiness.db.entity.systemparams.SystemParams;
import com.t.bricks.bussiness.db.mapper.systemparams.SystemParamsMapper;
import com.t.bricks.model.Log;
import com.t.bricks.model.MsgEmity;

@Repository
public class SystemParamsDaoImpl implements SystemParamsDao<SystemParams> {
	
	@Autowired
	private SystemParamsMapper systemParamsMapper;

	/**
	 * 取所有免拦截系统参数对象集合
	 * @return
	 */
	@Override
	public MsgEmity findByNoIntercept() {
		List<SystemParams> list = null;
		try {
			list = systemParamsMapper.findByNoIntercept();
			if (null == list) {
				Log.error("查询数据发生异常,执行的返回值为:null,预期值不应为null");
				return new MsgEmity(false, "查询操作失败！", 7001);
			}
		} catch (Exception e) {
			Log.error("查询所有免拦截数据发生异常:", e.getMessage());
			return new MsgEmity(false, "查询请求失败，请查看异常日志！", 7002);
		}
		
		return new MsgEmity(true, "查询成功！", list);
	}
	
}
